lunomobs:register_mob("lunomobs:sheep", {
	type = "animal",
	hp_max = 5,
	--xp_give = 3,
	collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
	textures = {"mobs_sheep.png"},
	visual = "mesh",
	mesh = "mobs_sheep.x",
	makes_footstep_sound = true,
	walk_velocity = 2,
	armor = 200,
	drops={ 
		{name="lunorecipes:meat_raw", chance=5, min=1, max=1,},
	},
	drawtype = "front",
	water_damage = 1,
	lava_damage = 10,
	light_damage = 0,
	shadow_damage = 1,
	sounds = {
		random = "mobs_sheep",
		die = "mobs_sheep",
	},
	view_range = 5,
	animation = {
		speed_normal = 15,
		stand_start = 0,
		stand_end = 80,
		walk_start = 81,
		walk_end = 100,
	},
	follow = "farming:wheat", --Tipos de comidas que atraem este animal
	prop_unnaked = { textures={"mobs_sheep.png"}, mesh="mobs_sheep.x", }, --Aparencia do mob quando [[[NAO]]] extraido um item expecial.
	prop_naked = { textures={"mobs_sheep_shaved.png"}, mesh="mobs_sheep_shaved.x", }, --Aparencia do mob quando extraido um item expecial.
	foods = { --Tipos de comidas que domesticam este animal
		"default:junglegrass", "farming:wheat", "watershed:goldengrass", "junglegrass:medium", 
		"default:grass_1", "default:grass_2", "default:grass_3", "default:grass_4", "default:grass_5", 
	},
	naker_tool = "lunorecipes:cut", --Que ferramenta especial extrai algum item deste mob
	naked_item = "wool:white", --Que tipo de item ser extraido deste mob usando ferramenta especial.
	damage_thief = 7, --Dano em caso alguem tente interagir um pet domesticado que nao lhe pertece.
	--[[
	on_rightclick = function(self, clicker)
		local item = clicker:get_wielded_item()
		if 
			item:get_name() == "default:junglegrass" or item:get_name() == "farming:wheat"  or item:get_name() == "watershed:goldengrass" 
			or item:get_name() == "default:grass_1" or item:get_name() == "default:grass_2" 
			or item:get_name() == "default:grass_3" or item:get_name() == "default:grass_4" or item:get_name() == "default:grass_5" 
		then
			if not minetest.setting_getbool("creative_mode") then
				item:take_item()
				clicker:set_wielded_item(item)
				minetest.sound_play("obj_chew", {pos=self.pos, max_hear_distance = 5}) --toca som "obj_chew".ogg a distancia de 5 blocos do usuário.
			end
			if self.naked then
				self.food = (self.food or 0) + 1
				if self.food >= 8 then
					self.food = 0
					self.naked = false
					self.object:set_properties({
						textures = {"mobs_sheep.png"},
						mesh = "mobs_sheep.x",
					})
					minetest.sound_play("mobs_sheep", {pos=self.pos, max_hear_distance = 5})
				end
			elseif self.tamed == nil or not self.tamed then
				self.tamed = true
				self.owner = clicker:get_player_name()
				minetest.chat_send_player(clicker:get_player_name(), "Esta ovelha foi domesticado!")
				minetest.sound_play("mobs_sheep", {pos=self.pos, max_hear_distance = 5})
			elseif self.pregnant_time == nil or self.pregnant_time <= 0 then
				self.pregnant_time = 300 + os.time() --5 minutos para ter filhotes
				minetest.chat_send_player(clicker:get_player_name(), "Esta ovelha vai ter filhotes!")
				minetest.sound_play("mobs_sheep", {pos=self.pos, max_hear_distance = 5}) --toca som "mobs_sheep".ogg a distancia de 5 blocos do usuário.
			end
		elseif item~=nil and item:get_name()~=nil and item:get_name() == "lunorecipes:cut" and clicker:get_inventory() and not self.naked then --Verifica se o player temn espaço no inventário[clicker:get_inventory()] e e se a ovelha jã não esta tosquiada[self.naked]. 
			self.naked = true
			if minetest.registered_items["wool:white"] then
				--clicker:get_inventory():add_item("main", ItemStack("wool:white "..math.random(1,3)))
				clicker:get_inventory():add_item("main", ItemStack("wool:white 1")) --So dará uma
			end
			self.object:set_properties({
				textures = {"mobs_sheep_shaved.png"},
				mesh = "mobs_sheep_shaved.x",
			})
			minetest.sound_play("mobs_sheep", {pos=self.pos, max_hear_distance = 5})
		else
			minetest.sound_play("mobs_sheep", {pos=self.pos, max_hear_distance = 5})
		end
	end,
	]]--
})
--lunomobs:register_spawn("lunomobs:sheep", {"default:dirt_with_grass", "default:grass_1", "default:grass_2", "default:grass_3", "default:grass_4", "default:grass_5"}, 20, 8, 9000, 1, 31000)
lunomobs:register_spawn("lunomobs:sheep", {
	"default:dirt", "default:dirt_with_grass", "watershed:grass", 
	"default:grass_1", "default:grass_2", "default:grass_3", "default:grass_4", "default:grass_5", 
	"default:dirt_with_snow", "default:snowblock", "default:ice"
}, 20, 8, 5000, 1, 31000)

minetest.register_craftitem("lunomobs:sheep", {
	description = "Ovelha",
	groups = { mobs=1 },
	inventory_image = "mob_sheep.png",
	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.above then
			minetest.env:add_entity(pointed_thing.above, "lunomobs:sheep")
			minetest.sound_play("mobs_sheep", {pos=placer.pos, max_hear_distance = 5}) --toca som "mobs_sheep".ogg a distancia de 5 blocos do usuário.
			if not minetest.setting_getbool("creative_mode") then itemstack:take_item() end
		end
		return itemstack
	end,
})

minetest.register_alias("sheep"	, "lunomobs:sheep")
minetest.register_alias("ovelha"	, "lunomobs:sheep")
